package main

import (
	"fmt"
	"log"
)

// type ComedyError string
//
// func (c ComedyError) Error() string {
// 	return string(c)
// }

type OverErr float64

func (o OverErr) Error() string {
	return fmt.Sprintf("over by %0.2f degress!", o)
}

func checkTemperature(actual float64, safe float64) error {
	excess := actual - safe
	if excess > 0 {
		return OverErr(excess)
	}
	return nil
}

func main() {
	var err error = checkTemperature(121.111, 100)
	if err != nil {
		log.Fatal(err)
	}
	// var err error
	// 	err = ComedyError("hello error in interface")
	// 	fmt.Println(err)
}
